<?php
//debug($subjects);
?>


<table width="1024px">
    
    <tr><td>&nbsp;</td></tr>
    <tr>
        <td>

            <table width="100%" id="table" >
                <tr >
                    <th width="300px"><?php  echo $this->Paginator->sort('Title', 'Subject.subject');?></th>
                    <th width="150px"><?php echo $this->Paginator->sort('Type', 'FlaggedSubject.type'); ?></th>
                    <th width="200px"><?php echo $this->Paginator->sort('User', 'User.username'); ?></th>
                    <th width="250px"><?php echo "Comment"; ?></th>
                    <th width="150px"><?php echo $this->Paginator->sort('Time', 'FlaggedSubject.created'); ?></th>
                    <th width="40px">Edit</th>
                    <?php if($this->Access->check('Subject', 'delete')){ ?><th width="40px">Delete</th><?php }?>

                </tr>
                <?php foreach ($subjects as $data): ?>
                    <tr id="table_content">
                        <td><?php echo $data['Subject']['subject']; ?></td>
                        <td><?php echo $data['FlaggedSubject']['type']; ?></td>
                        <td><?php echo $data['User']['username'];
                                  echo "<br>[".$data['User']['email']."]";?></td>
                        <td><?php echo $data['FlaggedSubject']['comment']; ?></td>
                        <td><?php echo $data['FlaggedSubject']['created'] ?></td>
                        <td><?php echo $this->Html->link($this->Html->image('user_edit.png', array('alt' => 'Edit', 'border' => '0')), array('action' => 'admin_edit', $data['Subject']['id']), array('escape' => false));  ?></td>
                        <td><?php  if($this->Access->check('Subject', 'delete')) echo $this->Html->link($this->Html->image('trash.png', array('alt' => 'Delete', 'border' => '0')), array('action' => 'admin_delete_flagged', $data['FlaggedSubject']['id']), array('escape' => false, 'onclick' => "return confirm('Are you sure you want to delete?')")); ?></td>
                    </tr>
                        <?php endforeach; ?>
                <tr><td><?php
                        echo $this->Paginator->numbers();
                        ?></td></tr>
            </table>
        </td>
    </tr>
</table>
<!--- ***********************************   This will be used to print screen        *************************************/--->

